UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JjQbbycZ/wxqjoMEmmXsJCpYo93Z7PEj6u/ezUepUR0='
WHERE
key_id = '60e81d7c11226931cef0ac92b08ebb5faa05134b3f21037852dd30527510c7ad'
AND (
token = 'JjQbbycZ/wxqjoMEmmXsJCpYo93Z7PEj6u/ezUepUR0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)