UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Iktcou5GjNbfFBj4gKOcrdU1rYfX/pokD+zoy4tgkZk='
WHERE
key_id = 'b3bc70e1f916437a318a3e2327e6eb44c2b73ea441ed131d4ed49b12cdac14af'
AND (
token = 'Iktcou5GjNbfFBj4gKOcrdU1rYfX/pokD+zoy4tgkZk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)