UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eIcfhtpxRuWFskwtJNoWY54JzHivVVbGz6I7UF9dly8='
WHERE
key_id = '46c0a8a213b96770fabb54826e7c112df92a3b1626f27bfd72c612dd471c5d15'
AND (
token = 'eIcfhtpxRuWFskwtJNoWY54JzHivVVbGz6I7UF9dly8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)