UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qnPoMPNVn49O3leB1Rv2yYMZJAH3GGDI6OLhwQd/lTY=' 
WHERE 
  key_id = 'c743da2e21f3ee82acdd83a5d4f6d756566a699188c8bc1a08bfb6c3a58fa057' 
  AND (
    token = 'qnPoMPNVn49O3leB1Rv2yYMZJAH3GGDI6OLhwQd/lTY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035