UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nEjZ5KrSTZdE+Q6Q1Ck3MVVONRYPkNHSk/GSlHjlSC4='
WHERE
key_id = '64895631f29ad4461674c1378a995a8fa72a484f06d9ea9e61b2d411d5145ea4'
AND (
token = 'nEjZ5KrSTZdE+Q6Q1Ck3MVVONRYPkNHSk/GSlHjlSC4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)