UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xw/voGSAr+4QzMvcBWp+w9bkR9E6BeyBMJfzJG1MObU=' 
WHERE 
  key_id = 'a3c582ebd876f364902a422d5dacc36fd9ff3f8bff60c54f1b79b74522feda7e' 
  AND (
    token = 'xw/voGSAr+4QzMvcBWp+w9bkR9E6BeyBMJfzJG1MObU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037