UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MnnfCT0srbyxkoKrYHs5ol579bMdHFRw07sxLss1iWk=' 
WHERE 
  key_id = 'def7240892528a734c8e8d3e923335ca8d1e15c55df571d379eb02a4058951f7' 
  AND (
    token = 'MnnfCT0srbyxkoKrYHs5ol579bMdHFRw07sxLss1iWk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032