UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eWi1N8jGx+jPhxEmofgJgigFK7nP6Lmpp03SWesa2wY=' 
WHERE 
  key_id = '20aa4e414414733334c5b0299ab5bc3678a8bfcfd4feada32b16d0b36c3b5fe1' 
  AND (
    token = 'eWi1N8jGx+jPhxEmofgJgigFK7nP6Lmpp03SWesa2wY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041