UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YqdZtCygukkZe0Qmlu9G+tyaLXZ0MdXrGYq48tk60xQ='
WHERE
key_id = '7c45e0723c8350dbc236b184fa2538a008936d62fc28c1f6ff9c733fc2717908'
AND (
token = 'YqdZtCygukkZe0Qmlu9G+tyaLXZ0MdXrGYq48tk60xQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)