UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'REeVAqahCCEyZ/ywFvimMgXcTbLVa/K2QGkV1/bMmko='
WHERE
key_id = 'c5cf9b61e185d71aee385e0cdfb88d76d620e2b6d4ac046427ec7db05bb4f47d'
AND (
token = 'REeVAqahCCEyZ/ywFvimMgXcTbLVa/K2QGkV1/bMmko='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)