UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VxUK4R6hiPbkxSgMuN5iw6Plq2qZCh2WaZV2FGSiYMQ='
WHERE
key_id = 'bc02ef4549e56c4a50a98dbaac7f84cf43ec3dca7e3de3519adcc670ead71354'
AND (
token = 'VxUK4R6hiPbkxSgMuN5iw6Plq2qZCh2WaZV2FGSiYMQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)