UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'B7Apz859D/DYFow6nrraN8BiPsYxzsg42We949VXXic='
WHERE
key_id = '76b254ce80ad34803e79db24e0914998b5de952332fe45eaf2eea57d03287fb0'
AND (
token = 'B7Apz859D/DYFow6nrraN8BiPsYxzsg42We949VXXic='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)