UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nyIllMstBEoWp4KleEAlLghQ8AMstj6JwSKpk9ktipY='
WHERE
key_id = '6aa6229f030abf5f84b42c7700f0508c217c642d1a18917e8e954c85e7eb05ff'
AND (
token = 'nyIllMstBEoWp4KleEAlLghQ8AMstj6JwSKpk9ktipY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)