UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9QpSC50R3n01++3wsE8k7L3z8MsNa/RMdIRC0ZC4kMM='
WHERE
key_id = 'd225690eb647c95ff2cb39acb0d5037bce268e5bfd7a275f877e16ac5a0bc93e'
AND (
token = '9QpSC50R3n01++3wsE8k7L3z8MsNa/RMdIRC0ZC4kMM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)