UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o3YNEeOWr/M/7tOMg5cufSbEsQ9ROU+oSCzx0L2v6wQ=' 
WHERE 
  key_id = 'f7b4a406c0edb93e213dc749d81bcd18e4f5d794121bc78ae6cf15d5c41b19d9' 
  AND (
    token = 'o3YNEeOWr/M/7tOMg5cufSbEsQ9ROU+oSCzx0L2v6wQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047