UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VOgUoOYIeo5qoSHNw6k6BZAaKgYmtFdR6pSwjna+fWU=' 
WHERE 
  key_id = '8bab6dc8ecccb567a0348a9feb5443a803dac956baf2447f269485f2f096329d' 
  AND (
    token = 'VOgUoOYIeo5qoSHNw6k6BZAaKgYmtFdR6pSwjna+fWU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047