UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pts6xtPV3RZzZV+rlvTb77K4GVF+Ygii33o/xX7Aq+o='
WHERE
key_id = 'ab953f5dda26857b230181fcfce9c02d4e848824dc9c2ae56e2c76a14b6d4888'
AND (
token = 'pts6xtPV3RZzZV+rlvTb77K4GVF+Ygii33o/xX7Aq+o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)