UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5hv1rlQ09RyQ4wj4qYJrWXXVoYg7EeEliPHzRejM0PY=' 
WHERE 
  key_id = '152b9e6a79b056c7044be2dfafee299e44a25995fb9a0c45b39c5b2392ab65a9' 
  AND (
    token = '5hv1rlQ09RyQ4wj4qYJrWXXVoYg7EeEliPHzRejM0PY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00073