UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2ChT6Gl5gy8e/MuPBh1+mo9nzovp1Zm8mfokDLBcaV8='
WHERE
key_id = '482d179e2438d73cf4ac70f62acf158751cc54ef82ff286e7046c32e2af128ba'
AND (
token = '2ChT6Gl5gy8e/MuPBh1+mo9nzovp1Zm8mfokDLBcaV8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)