UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yb7dRQ0t1A1G93HMy+rp9T02TCPWkDjUklOKayk9nvk=' 
WHERE 
  key_id = '02d9fbb94ffcdc487753e3021f9e2616d49828932eb459a892c640892b0c8aef' 
  AND (
    token = 'yb7dRQ0t1A1G93HMy+rp9T02TCPWkDjUklOKayk9nvk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027