UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z2U+mKCNCiU0aIcvZnRtOdcIcXTF6mN04eBdvH9Ai6A='
WHERE
key_id = '036dd8a4af521410cf17a4c427bc08136e57dc5a7163f861042d43b7dd4f2efa'
AND (
token = 'Z2U+mKCNCiU0aIcvZnRtOdcIcXTF6mN04eBdvH9Ai6A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)