UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'J21AWqCWerbUfE0B/pG2VtcbZFkriOAIDq1SJ1gutsc='
WHERE
key_id = '557e022744f096bfaec06f71a26cba653298fbdcc570cda882af5019ac7de3cd'
AND (
token = 'J21AWqCWerbUfE0B/pG2VtcbZFkriOAIDq1SJ1gutsc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)