UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zHHatrcP3YGjBjK/ZsdnyTt5eJ4lXrQgo7nrfpoRffs='
WHERE
key_id = '8e648cf675c3031388588cb90f09e98dda7bb8b431ba043999e7d5a44f0c60c8'
AND (
token = 'zHHatrcP3YGjBjK/ZsdnyTt5eJ4lXrQgo7nrfpoRffs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)