UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QNobONxJjV8eelZ565Yf2Ytz5RA9C0FZ/CF17lkuCO0=' 
WHERE 
  key_id = 'ddf715fba67d96a1984a4f3293a3efa2255818c22596e7fd335fc995db8bc36d' 
  AND (
    token = 'QNobONxJjV8eelZ565Yf2Ytz5RA9C0FZ/CF17lkuCO0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032