UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '60OH+DX8exjeP2GCl0FJTacwUNowVbhyscjzWqLwLis=' 
WHERE 
  key_id = '66836c936672b975c87e54b79bd63d211c78eb281e2cee829d62d6c34ac748ef' 
  AND (
    token = '60OH+DX8exjeP2GCl0FJTacwUNowVbhyscjzWqLwLis=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037