UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'igzD30qDatxIthfSea14RIcAtqNK2hf1uDANto6bLpU=' 
WHERE 
  key_id = '2f28bab98171c2308de69aca67db9561447c224f3cb9b7e6b47937bdd83c3c36' 
  AND (
    token = 'igzD30qDatxIthfSea14RIcAtqNK2hf1uDANto6bLpU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015