UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NC1CupZ57+e+KLFSOj0Ow6O8/YAvVi/6jL2RzAJQ4DY='
WHERE
key_id = '67dbe2452fed94642b5ddb90f27f09e921bcc84221d27fe11141bdaa81eb9129'
AND (
token = 'NC1CupZ57+e+KLFSOj0Ow6O8/YAvVi/6jL2RzAJQ4DY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)