UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nYoolkeNgrefyZblMiVpEFSnaEKzWEdgnliRN80nMkU='
WHERE
key_id = 'f110aab4987a82eb30d7cf755794d294b8d8a1adfb29c048397b35f717e65974'
AND (
token = 'nYoolkeNgrefyZblMiVpEFSnaEKzWEdgnliRN80nMkU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)