UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1ozGRS1SMzxVAYuC37jqOydXdsrM65et/msZlre2yb8='
WHERE
key_id = 'bf78bfce4bd3a1dba3fbc0454f359d270f3828a858b0a59f4992c674a0b8dc3e'
AND (
token = '1ozGRS1SMzxVAYuC37jqOydXdsrM65et/msZlre2yb8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)