UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nut5weFdHCN+1gv/yBHW/VJw/5/clV7CteAHDYHt4wg=' 
WHERE 
  key_id = '2ce828c2d6e1eadbd1ec9010cea7e5fc0e88bdcb295bce0998b1e5d90571214c' 
  AND (
    token = 'nut5weFdHCN+1gv/yBHW/VJw/5/clV7CteAHDYHt4wg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025