UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'epaNDPJu+NSxzWbyQ5zCccp6owX2gnHTnsMREegP4WE='
WHERE
key_id = '2d972219ba5a1d6909b4cfa55fcd4dcb701cb3f9660832e3e7f262ae5e78ef30'
AND (
token = 'epaNDPJu+NSxzWbyQ5zCccp6owX2gnHTnsMREegP4WE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)