UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3DEfKMXdjx+zv3f0ObPJUJcDA48HJQLQXBUOWEY3xgs='
WHERE
key_id = '95e9262600c3fa4e5f5351f6d423dc5b224c4fc37b701a55da3c807887f57168'
AND (
token = '3DEfKMXdjx+zv3f0ObPJUJcDA48HJQLQXBUOWEY3xgs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)