UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Nqf5nLpoTN9ThQui0kFWEHXe0GlKGyG22zWMYuJBvYg='
WHERE
key_id = '22cde89c89bfa1a6f06a5dc557ccff8e07f03fa7b259aa7ab05d702cb3703470'
AND (
token = 'Nqf5nLpoTN9ThQui0kFWEHXe0GlKGyG22zWMYuJBvYg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)