UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sDRtHESBYxugtR9agUJS7r94cmhfVr2vdyloqb0U7zA=' 
WHERE 
  key_id = '5bc8488b2e9b2100ad951460cb7b8c9da6d04262eb98d95a1a554e63aa780e1e' 
  AND (
    token = 'sDRtHESBYxugtR9agUJS7r94cmhfVr2vdyloqb0U7zA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039