UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'E23TeTf/j4C7FBrTHztQ94L63LSKKv/bJg5DeFyOS5s=' 
WHERE 
  key_id = '591399b6e600fa1785089596f34567003d8f5cf9b3531796a6466d7707f378d1' 
  AND (
    token = 'E23TeTf/j4C7FBrTHztQ94L63LSKKv/bJg5DeFyOS5s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033