UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MII1AUxDrtMfbGFnacGlXF3dFlpAxp5O6v+iG51eI24='
WHERE
key_id = '09f60b3ab39bd4a9aba3e59ea807ebd439f8f1dc2a0d5df18ea4f9765e10db7d'
AND (
token = 'MII1AUxDrtMfbGFnacGlXF3dFlpAxp5O6v+iG51eI24='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)