UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HPuAtM/3FpknZmydmRxwqKGfCYo/fp99L20eL9LS+PE='
WHERE
key_id = '81ee8cb59d0f4270d768077ca682bb3e5075c6ea836abedeb7edaaf9e1061cdf'
AND (
token = 'HPuAtM/3FpknZmydmRxwqKGfCYo/fp99L20eL9LS+PE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)