UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cBvl1Lghbx2zBFsMY8R3Qk5W6VBJA9Vc2sYThiolm5M='
WHERE
key_id = '41e762e0f8c74993472ab400376a0e7849339ef7c0d9cd79f0d187228c9f01ca'
AND (
token = 'cBvl1Lghbx2zBFsMY8R3Qk5W6VBJA9Vc2sYThiolm5M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)