UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ls5XnHa2ARg9HZxp/K8MZmlcLRUsos5KJd9BPzHAWeg=' 
WHERE 
  key_id = '7725be07e07cf2d78dd208608af5b80c0b1b5c22c9d9cbd328bad3e04fa05fe9' 
  AND (
    token = 'Ls5XnHa2ARg9HZxp/K8MZmlcLRUsos5KJd9BPzHAWeg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020