UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AvxxisdXj28qQN8tZ5452wSNeXxBU96+XVFyYbOElOg='
WHERE
key_id = '2cf9286502a34ca2e484a647303149eefe524575abe1a98b638c1482205fec76'
AND (
token = 'AvxxisdXj28qQN8tZ5452wSNeXxBU96+XVFyYbOElOg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)